using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WebFoundation;

namespace MHI.InspectionManager.Interfaces
{
	/// <summary>
	/// DevMaintenancedetailT,table entity:dev_maintenancedetail_t 
	/// </summary>
	public class DevMaintenancedetailT
	{
		public static readonly string KeyId;
		public static readonly string KeyJobId;
		public static readonly string KeyIsDelegate;
		public static readonly string KeyContractNo;
		public static readonly string KeyTroubleDesc;
		public static readonly string KeyTroubleDiagnosis;
		public static readonly string KeyMaintenanceContent;
		public static readonly string KeyAcceptContent;
		public static readonly string KeyGmtCreated;
		public static readonly string KeyPersonModified;
		public static readonly string KeyGmtModified;
		public static readonly string KeyStateInfo;
		public static readonly string KeyIsUse;
		public static readonly string KeyVersion;
		

		static DevMaintenancedetailT()
		{
			KeyId = ExpressionHelper.GetPropertyName<DevMaintenancedetailT>(r => r.Id);
			KeyJobId = ExpressionHelper.GetPropertyName<DevMaintenancedetailT>(r => r.JobId);
			KeyIsDelegate = ExpressionHelper.GetPropertyName<DevMaintenancedetailT>(r => r.IsDelegate);
			KeyContractNo = ExpressionHelper.GetPropertyName<DevMaintenancedetailT>(r => r.ContractNo);
			KeyTroubleDesc = ExpressionHelper.GetPropertyName<DevMaintenancedetailT>(r => r.TroubleDesc);
			KeyTroubleDiagnosis = ExpressionHelper.GetPropertyName<DevMaintenancedetailT>(r => r.TroubleDiagnosis);
			KeyMaintenanceContent = ExpressionHelper.GetPropertyName<DevMaintenancedetailT>(r => r.MaintenanceContent);
			KeyAcceptContent = ExpressionHelper.GetPropertyName<DevMaintenancedetailT>(r => r.AcceptContent);
			KeyGmtCreated = ExpressionHelper.GetPropertyName<DevMaintenancedetailT>(r => r.GmtCreated);
			KeyPersonModified = ExpressionHelper.GetPropertyName<DevMaintenancedetailT>(r => r.PersonModified);
			KeyGmtModified = ExpressionHelper.GetPropertyName<DevMaintenancedetailT>(r => r.GmtModified);
			KeyStateInfo = ExpressionHelper.GetPropertyName<DevMaintenancedetailT>(r => r.StateInfo);
			KeyIsUse = ExpressionHelper.GetPropertyName<DevMaintenancedetailT>(r => r.IsUse);
			KeyVersion = ExpressionHelper.GetPropertyName<DevMaintenancedetailT>(r => r.Version);
		}
		

		private long _id; 
		private long? _jobId; 
		private long? _isDelegate; 
		private byte _contractNo; 
		private string _troubleDesc; 
		private string _troubleDiagnosis; 
		private string _maintenanceContent; 
		private string _acceptContent; 
		private DateTime? _gmtCreated; 
		private string _personModified; 
		private DateTime? _gmtModified; 
		private float? _stateInfo; 
		private int _isUse; 
		private long _version; 
		

		/// <summary>
		///  Id, column: id required
		/// </summary>
		[DisplayName("编码")]
		[Required]
		public long Id
		{
			get{ return _id; }
			set
			{
				if(_id != value)
				{
					_id = value;
					NotifyOfChange(KeyId);
				}
			}
		}

		/// <summary>
		///  JobId, column: job_id 
		/// </summary>
		[DisplayName("工单ID")]
		public long? JobId
		{
			get{ return _jobId; }
			set
			{
				if(_jobId != value)
				{
					_jobId = value;
					NotifyOfChange(KeyJobId);
				}
			}
		}

		/// <summary>
		///  IsDelegate, column: is_delegate 
		/// </summary>
		[DisplayName("是否委外")]
		public long? IsDelegate
		{
			get{ return _isDelegate; }
			set
			{
				if(_isDelegate != value)
				{
					_isDelegate = value;
					NotifyOfChange(KeyIsDelegate);
				}
			}
		}

		/// <summary>
		///  ContractNo, column: contract_no 
		/// </summary>
		[DisplayName("合同编号")]
		[Required]
		public byte ContractNo
		{
			get{ return _contractNo; }
			set
			{
				if(_contractNo != value)
				{
					_contractNo = value;
					NotifyOfChange(KeyContractNo);
				}
			}
		}

		/// <summary>
		///  TroubleDesc, column: trouble_desc 
		/// </summary>
		[DisplayName("故障描述")]
		public string TroubleDesc
		{
			get{ return _troubleDesc; }
			set
			{
				if(_troubleDesc != value)
				{
					_troubleDesc = value;
					NotifyOfChange(KeyTroubleDesc);
				}
			}
		}

		/// <summary>
		///  TroubleDiagnosis, column: trouble_diagnosis 
		/// </summary>
		[DisplayName("原因分析")]
		public string TroubleDiagnosis
		{
			get{ return _troubleDiagnosis; }
			set
			{
				if(_troubleDiagnosis != value)
				{
					_troubleDiagnosis = value;
					NotifyOfChange(KeyTroubleDiagnosis);
				}
			}
		}

		/// <summary>
		///  Maintenance·Content, column: maintenance·_content 
		/// </summary>
		[DisplayName("维修内容")]
		public string MaintenanceContent
		{
			get{ return _maintenanceContent; }
			set
			{
				if(_maintenanceContent != value)
				{
					_maintenanceContent = value;
					NotifyOfChange(KeyMaintenanceContent);
				}
			}
		}

		/// <summary>
		///  AcceptContent, column: accept_content 
		/// </summary>
		[DisplayName("评价情况")]
		public string AcceptContent
		{
			get{ return _acceptContent; }
			set
			{
				if(_acceptContent != value)
				{
					_acceptContent = value;
					NotifyOfChange(KeyAcceptContent);
				}
			}
		}

		/// <summary>
		///  GmtCreated, column: gmt_created 
		/// </summary>
		[DisplayName("@desc创建时间")]
		public DateTime? GmtCreated
		{
			get{ return _gmtCreated; }
			set
			{
				if(_gmtCreated != value)
				{
					_gmtCreated = value;
					NotifyOfChange(KeyGmtCreated);
				}
			}
		}

		/// <summary>
		///  PersonModified, column: person_modified 
		/// </summary>
		[DisplayName("@desc更新人")]
		public string PersonModified
		{
			get{ return _personModified; }
			set
			{
				if(_personModified != value)
				{
					_personModified = value;
					NotifyOfChange(KeyPersonModified);
				}
			}
		}

		/// <summary>
		///  GmtModified, column: gmt_modified 
		/// </summary>
		[DisplayName("@desc更新时间")]
		public DateTime? GmtModified
		{
			get{ return _gmtModified; }
			set
			{
				if(_gmtModified != value)
				{
					_gmtModified = value;
					NotifyOfChange(KeyGmtModified);
				}
			}
		}

		/// <summary>
		///  StateInfo, column: state_info 
		/// </summary>
		[DisplayName("标识状态")]
		public float? StateInfo
		{
			get{ return _stateInfo; }
			set
			{
				if(_stateInfo != value)
				{
					_stateInfo = value;
					NotifyOfChange(KeyStateInfo);
				}
			}
		}

		/// <summary>
		///  IsUse, column: is_use 
		/// </summary>
		[DisplayName("是否可用")]
		[Required]
		public int IsUse
		{
			get{ return _isUse; }
			set
			{
				if(_isUse != value)
				{
					_isUse = value;
					NotifyOfChange(KeyIsUse);
				}
			}
		}

		/// <summary>
		///  Version, column: version 
		/// </summary>
		[DisplayName("版本")]
		[Required]
		public long Version
		{
			get{ return _version; }
			set
			{
				if(_version != value)
				{
					_version = value;
					NotifyOfChange(KeyVersion);
				}
			}
		}

		public event PropertyChangedEventHandler PropertyChanged;

		private void NotifyOfChange(string propertyName)
		{
			if (this.PropertyChanged != null)
			{
				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
			}
		}
	}
}
